Build Tools

  • They execute compilation commands directly (e.g., gcc , clang , javac ).

  • Work with specific configuration files ( Makefile , build.ninja ).

  • Called manually or by meta-build tools.

Command Runners

About
  • Batch file style.

  • No Incremental Builds, no Change Detection.

    • "Has this source file changed since it was compiled, or its dependencies?"

Just (or JustFile)
  • Impressions :

    • Seems to provide very few options for args and conditional execution of programs.

    • Apparently on Windows it must be run via cmd or powershell, so any programming is internally done by the chosen shell, OR through Just’s own language.

    • Didn’t like it.

  • Just .

    • Download and place the folder in the environment.

  • just  is a command runner, similar to make , but with a more modern and simplified syntax.

  • It has no language-specific knowledge like C, Rust, etc.

  • You define recipes in the justfile , which are basically terminal commands to execute.

  • For C projects, make  or more specialized tools like CMake  or Meson  provide features like:

    • Dependency detection.

    • Incremental compilation.

    • Cross-platform support.

  • just  is more useful when you want a simple file to organize reusable commands (build, run, test, etc.), without dependency logic between files.

  • Tutorial :

    recipe-name:
      echo 'This is a recipe!'
    
    # this is a comment
    another-recipe:
      @echo 'This is another recipe.'
    
    • Running just  with no arguments runs the first recipe in the justfile .

    • One or more arguments specify the recipe(s) to run.

    • Recipes can depend on other recipes. Here the test  recipe depends on the build  recipe, so build  will run before test :

      build:
        cc main.c foo.c bar.c -o main
      
      test: build
        ./test
      
      sloc:
        @echo "`wc -l *.c` lines of code"
      
    • Recipes without dependencies run in the order given on the command line:

      $ just build sloc
      cc main.c foo.c bar.c -o main
      1337 lines of code
      
Batch
  • .

Ninja

  • Ninja .

  • "Focus on speed".

  • Less flexibility.

  • "It's designed to have its input files generated by a higher-level build system".

    • So don’t use it alone; have something generate Ninja files using a Meta Build System, like CMake.

    • Not designed to be written manually.

  • My version :

    • 1.12.1.

  • Ninja vs CMake .

    • Ninja vs CMake doesn’t make sense, but Ninja WITH CMake does; it’s a good choice, especially for large projects.

GNU Make

MSBuild / Visual Studio Project

Disadvantages
  • Completely Windows-focused.

    • Using a VS project limits deployment targets.

    • "Technically possible to export to other platforms, but not easy."

  • Less Flexible.

    • You may not always be able to do or get what you want.

MSBuild
  • MSBuild  is Microsoft’s default build engine for .NET, C++, and others.

  • It interprets project files ( .vcxproj , .csproj ) and executes build steps.

  • Works via command line and is used internally by Visual Studio.

  • Visual Studio uses MSBuild internally when you click Build Solution.

  • Visual Studio does not compile directly  â€“ it calls MSBuild  (or other systems like CMake).

Visual Studio solution generated by CMake
  • The projects install , ALL_BUILD , and ZERO_CHECK  are defaults when CMake generates solutions for Visual Studio.

  • ALLBUILD

    • Function: Project that depends on all other projects created by CMake, except INSTALL  and ZEROCHECK .

    • Used to: Build all defined targets (executables, libraries, etc.) at once.

    • Behavior: Compiling ALLBUILD  builds everything configured in CMake.

  • ZEROCHECK

    • Function: Ensures CMake reconfigures the project if CMakeLists.txt files change.

    • Used to: Automate regeneration of project files when build configuration changes.

    • Behavior: Runs automatically before any build, unless disabled.

  • INSTALL

    • Function: Executes rules defined by install(...)  commands in CMakeLists.txt.

    • Used to: Copy binaries, headers, libraries, etc., to defined directories (like /usr/local  or an install  folder).

    • Behavior: Only makes sense if the CMake script has installation instructions.

Bazel

  • From Google.

  • For multiple languages: Java, C++, Go, etc.

  • Requirements :

    • Bazelisk.

  • Bazel vs CMake .

    • User experience was kind of messy.

Gradle

  • Java/Kotlin.

  • Build manager for the JVM (Android, Java, etc.).

XCodeBuild

  • Build tool for macOS/iOS projects (Xcode).